import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { devPlugin, getReplacer } from './electron/plugins/devPlugin.ts'
import optimizer from "vite-plugin-optimizer";
import { buildPlugin } from './electron/plugins/buildPlugin.ts';

// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  plugins: [
    optimizer(getReplacer()),
    devPlugin(),
    vue(),
    buildPlugin()
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  server: {
    port: 3004
  }
})
